<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>支付密码</title>
    <link rel="stylesheet" href="assets/css/amazeui.min.css">
    <link rel="stylesheet" href="assets/css/app.css">
    <link rel="stylesheet" href="css/my/myBag.css">
</head>

<body>
    <div class="pay_pwd">
        <p>订单号：D123646547897</p>
        <p class="pay_num">
            ￥29.9
        </p>
        <p>请输入支付密码，以验证身份</p>
        <div class="input_pwd">
            <input type="password" maxlength="1">
            <input type="password" maxlength="1">
            <input type="password" maxlength="1">
            <input type="password" maxlength="1">
            <input type="password" maxlength="1">
            <input type="password" maxlength="1">
        </div>
    </div>
    <div class="complete_btn">
        <button class="bg-btn" type="button">确定</button>
    </div>
    <script src="js/jquery-1.11.3.js"></script>
    <script>
        $(".input_pwd input").focus();
        $(".input_pwd input").on("keyup", function (event) {
            if (event.which == 8) {
                $(this).val("").prev().focus();
            } else {
                if (!$(this).val().match(/^\d{1}$/)) {
                    $(this).val("");
                } else {
                    $(this).next().focus();
                }
            }
        });
    </script>
</body>

</html>